from django.db import models
from blog.models import Article


# Create your models here.
class Comment(models.Model):
    name = models.CharField(max_length=64)
    email = models.EmailField(max_length=128)
    url = models.URLField(blank=True)
    content = models.TextField()
    create_time = models.DateTimeField(auto_now_add=True)

    article = models.ForeignKey(Article)

    def __str__(self):
        return self.content[:20]

    class Meta:
        verbose_name = verbose_name_plural = '评论'
        db_table = 'comment'
